package com.zzc.qqchat.repository;

import com.zzc.qqchat.domain.Friends;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;

import java.util.ArrayList;
import java.util.Optional;

public interface FriendsRep extends JpaRepository<Friends,Integer> {

    @Query(value = "select * from friend  where user_Id=?1",nativeQuery = true)
    ArrayList<Friends> findByuserId(int userId);

    @Query(value = "select * from friend  where Id=?1",nativeQuery = true)
    Optional<Friends> findById(int Id);
}
